package com.lagou;
/**
 * 自定义zk序列化与反序列化类
 */

import org.I0Itec.zkclient.exception.ZkMarshallingError;
import org.I0Itec.zkclient.serialize.ZkSerializer;

public class ZkStrSerializer implements ZkSerializer {


    public byte[] serialize(Object o) throws ZkMarshallingError {
        return String.valueOf(o).getBytes();
        //return new byte[0];
    }

    public Object deserialize(byte[] bytes) throws ZkMarshallingError {
        return new String(bytes);
        //return null;
    }
}
